package com.example.goodpet.service;

import com.example.goodpet.bean.LoginData;
import com.example.goodpet.bean.MainChannel;
import com.example.goodpet.bean.User;
import com.example.goodpet.bean.UserPetInfo;
import com.example.goodpet.commentdialog.bean.FirstLevelBean;
import com.example.goodpet.commentdialog.bean.GoodpetCommentFirst;
import com.example.goodpet.commentdialog.bean.GoodpetCommentSecond;
import com.example.goodpet.commentdialog.bean.SecondLevelBean;
import com.example.goodpet.commentdialog.bean.TieziCommentFirst;
import com.example.goodpet.commentdialog.bean.TieziCommentSecond;
import com.example.goodpet.community.bean.TieziImage;
import com.example.goodpet.community.bean.UserTieziInfo;
import com.example.goodpet.home.homeRecommend.bean.GoodPetImageData;
import com.example.goodpet.home.homeRecommend.bean.TaobaoURL;
import com.example.goodpet.home.homeRecommend.bean.Tips;
import com.example.goodpet.utils.Constants;

import java.util.List;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface HomeService {
    /**
     * 获取数据更新
     * @return
     */
    @POST("file/json/"+Constants.UPDATE_URL)
    Call<ResponseBody> getUpdateInfo();
    /**
     * 主页面布局
     * @return
     */
    @POST(Constants.HOME_JSON)
    Call<ResponseBody> getHomeJson();
    /**
     * 淘宝链接
     * @return
     */
    @POST(Constants.TAOBAO_URL)
    Call<TaobaoURL> getTaobaoJson();

    /**
     * 养宠贴士
     * @return
     */
    @POST(Constants.TIPS_URL)
    Call<Tips> getTipsJson();

    /**
     * 分别对应MainChannel点击之后的布局
     * @return
     */
    @POST(Constants.MAIN_CHANNEL_DOG_JSON)
    Call<MainChannel> getChannelDogJson();

    @POST(Constants.MAIN_CHANNEL_CAT_JSON)
    Call<MainChannel> getChannelCatJson();

    @POST(Constants.MAIN_CHANNEL_PET_JSON)
    Call<MainChannel> getChannelPetJson();

    /**
     * 分页查所有宠物
     * @return
     */
    @POST(Constants.SELECT_ALL_USER_PET_INFO)
    Call<com.example.goodpet.bean.ResponseBody<List<UserPetInfo>>> selectAllUserPetInfo(@Query("seed") long seed,@Query("page") int page);



    /**
     * 通过定位地点和种类查出所有特定UserPet信息
     * @param location
     * @param species
     * @param page
     * @return
     */
    @POST(Constants.SELECT_SPECIFIC_USER_PET_INFO)
    Call<com.example.goodpet.bean.ResponseBody<List<UserPetInfo>>>
    selectSpecificUserPetInfo(@Query("seed") long seed,@Query("location") String location,@Query("speciesId") int species,@Query("page") int page);

    /**
     * 根据定位查所有其他宠物信息
     * @param location
     * @return
     */
    @POST(Constants.SELECT_MAIN_CHANNEL_USER_PET_INFO)
    Call<com.example.goodpet.bean.ResponseBody<List<UserPetInfo>>> selectMainChannelUserPetInfo
    (@Query("seed") long seed,@Query("location") String location,@Query("page") int page);


    /**
     * 根据搜索框输入的信息进行模糊查询
     * @param searchContent
     * @param page
     * @return
     */
    @POST(Constants.SELECT_USER_PET_INFO_BY_SEARCH)
    Call<com.example.goodpet.bean.ResponseBody<List<UserPetInfo>>>
    selectUserPetInfoBySearch
    (@Query("seed") long seed,@Query("searchContent") String searchContent,@Query("location") String location,@Query("page") int page);

    /**
     * 根据搜索内容模糊+精准搜索用户
     * @param searchContent
     * @param page
     * @return
     */
    @POST(Constants.SELECT_USER_BY_SEARCH)
    Call<com.example.goodpet.bean.ResponseBody<List<User>>>
                        selectUserBySearch (@Query("seed") long seed,@Query("searchContent") String searchContent,@Query("page") int page);

    @POST(Constants.SELECT_TIEZI_BY_SEARCH)
    Call<com.example.goodpet.bean.ResponseBody<List<UserTieziInfo>>>
    selectTieziBySearch (@Query("seed") long seed,@Query("searchContent") String searchContent,@Query("page") int page,@Query("userId") long userId);

    /**
     * 查询所有用户_帖子信息
     * @param page
     * @return
     */
    @POST(Constants.SELECT_ALL_USER_TIEZI_INFO)
    Call<com.example.goodpet.bean.ResponseBody<List<UserTieziInfo>>> selectAllUserTieziInfo (@Query("seed") long seed,@Query("loginUserId") long loginUserId,@Query("page") int page);
    /**
     * 用户点赞操作，更新数据库的user_like
     *
     * @param userId
     * @param tieziId
     * @return
     */
    @POST(Constants.UPDATE_USER_LIKE)
    Call<com.example.goodpet.bean.ResponseBody<Boolean>> updateUserLike(@Query("userId") long userId, @Query("tieziId") long tieziId);

    /**
     * 用户对帖子的收藏操作，更新数据库的tiezi_collect
     * @param userId
     * @param tieziId
     * @return
     */
    @POST(Constants.UPDATE_USER_TIEZI_COLLECT)
    Call<com.example.goodpet.bean.ResponseBody<Boolean>> updateUserTieziCollect(@Query("userId") long userId, @Query("tieziId") long tieziId);




    @POST(Constants.SELECT_GOODPET_COMMENT)
    Call<com.example.goodpet.bean.ResponseBody<List<FirstLevelBean>>> selectGoodpetComment(@Query("loginId") long loginId, @Query("petId") long petId,@Query("page") int page);

    @POST(Constants.SELECT_GOODPET_COMMENT_SECOND)
    Call<com.example.goodpet.bean.ResponseBody<List<SecondLevelBean>>> selectGoodpetCommentSecond(@Query("loginId") long loginId, @Query("firstId") long firstId, @Query("page") int page);

    @POST(Constants.SELECT_GOODPET_COMMENT_COUNT)
    Call<com.example.goodpet.bean.ResponseBody<Integer>> selectGoodpetCommentCount(@Query("petId") long petId);

    @POST(Constants.INSERT_GOODPET_COMMENT)
    Call<com.example.goodpet.bean.ResponseBody<GoodpetCommentFirst>> insertGoodpetComment(@Body GoodpetCommentFirst goodpetCommentFirst);

    @POST(Constants.INSERT_GOODPET_COMMENT_SECOND)
    Call<com.example.goodpet.bean.ResponseBody<GoodpetCommentSecond>> insertGoodpetCommentSecond(@Body GoodpetCommentSecond goodpetCommentSecond);

    @POST(Constants.GOODPET_COMMENT_LIKE)
    Call<com.example.goodpet.bean.ResponseBody<Integer>> goodpetCommentLike(@Query("loginId") long loginId,@Query("commentId") long commentId);

    @POST(Constants.GOODPET_COMMENT_LIKE_SECOND)
    Call<com.example.goodpet.bean.ResponseBody<Integer>> goodpetCommentLikeSecond(@Query("loginId") long loginId,@Query("commentId") long commentId);



    @POST(Constants.SELECT_TIEZI_COMMENT)
    Call<com.example.goodpet.bean.ResponseBody<List<FirstLevelBean>>> selectTieziComment(@Query("loginId") long loginId,@Query("tieziId") long tieziId,@Query("page") int page);

    @POST(Constants.SELECT_TIEZI_COMMENT_SECOND)
    Call<com.example.goodpet.bean.ResponseBody<List<SecondLevelBean>>> selectTieziCommentSecond(@Query("loginId") long loginId,@Query("firstId") long firstId,@Query("page") int page);

    @POST(Constants.SELECT_TIEZI_COMMENT_COUNT)
    Call<com.example.goodpet.bean.ResponseBody<Integer>> selectTieziCommentCount(@Query("tieziId") long tieziId);

    @POST(Constants.INSERT_TIEZI_COMMENT)
    Call<com.example.goodpet.bean.ResponseBody<TieziCommentFirst>> insertTieziComment(@Body TieziCommentFirst tieziCommentFirst);

    @POST(Constants.INSERT_TIEZI_COMMENT_SECOND)
    Call<com.example.goodpet.bean.ResponseBody<TieziCommentSecond>> insertTieziCommentSecond(@Body TieziCommentSecond tieziCommentSecond);

    @POST(Constants.TIEZI_COMMENT_LIKE)
    Call<com.example.goodpet.bean.ResponseBody<Integer>> tieziCommentLike(@Query("loginId") long loginId,@Query("commentId") long commentId);

    @POST(Constants.TIEZI_COMMENT_LIKE_SECOND)
    Call<com.example.goodpet.bean.ResponseBody<Integer>> tieziCommentLikeSecond(@Query("loginId") long loginId,@Query("commentId") long commentId);


}
